<h1 class="page-title">修改个人资料</h1>
<div class="well" ng-controller="ProfileController as vm">
  <p class="text-warning">{{vm.msg}}</p>
  <form class="form-horizontal" ng-submit="vm.updateProfile()" >
    <fieldset>
      <div class="span6">
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">会员号</label>
          <div class="controls">
            <input type="text" readonly class="input-large" ng-model="vm.user.user.memberId">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">企业名称</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.enterpriseName">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">纳税人识别号</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.taxerId">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">开户行</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.bankName">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">银行地址</label>
          <div class="controls">
            <input type="text" placeholder="" class="input-large" ng-model="vm.user.bankAddress">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">银行帐号</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.bankId">
            <p class="help-block"></p>
          </div>
        </div>
        
        
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">法人代表</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.representative">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">注册地址</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.registeredAddress">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">营业执照注册码</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.businessLicenseNumber">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <label class="control-label">上传营业执照</label>
          <!-- File Upload -->
          <div class="controls">
            <input type="text" id="lic" placeholder="" class="input-large" style="display: none"/>
            <image id="licImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('lic')">上传文件</a>
          </div>
        </div>
          <div class="control-group" ng-show="vm.user.user.role=='CARRIER'">
              <!-- Text input-->
              <label class="control-label" for="input01">身份证号码</label>
              <div class="controls">
                  <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.idCardNumber">
                  <p class="help-block"></p>
              </div>
          </div>
          <div class="control-group" ng-show="vm.user.user.role=='CARRIER'">
              <!-- Text input-->
              <label class="control-label" for="input01">身份证地址</label>
              <div class="controls">
                  <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.idCardAddress">
                  <p class="help-block"></p>
              </div>
          </div>
        <div class="control-group" ng-show="vm.user.user.role=='CARRIER'">
          <label class="control-label">上传身份证</label>
          <div class="controls">
            <input type="text" id="id" placeholder="" class="input-large" style="display: none"/>
            <image id="idImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('id')">上传文件</a>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">备用1</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.reserved1">
            <p class="help-block"></p>
          </div>
        </div>
      </div>
      <div class="span6">
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">组织机构代码</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.organizationNumber">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <label class="control-label">上传组织机构证</label>
          <!-- File Upload -->
          <div class="controls">
            <input type="text" id="org" placeholder="" class="input-large" style="display: none"/>
            <image id="orgImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('org')">上传文件</a>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">税务登记证号</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.taxRegistrationNumber">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <label class="control-label">上传税务登记证</label>
          <!-- File Upload -->
          <div class="controls">
            <input type="text" id="tax" placeholder="" class="input-large" style="display: none"/>
            <image id="taxImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('tax')">上传文件</a>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <!-- Text input-->
          <label class="control-label" for="input01">开户许可证号</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.bankLicenseNumber">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group" ng-show="vm.user.user.role=='SHIPPER'">
          <label class="control-label">上传开户许可证</label>
          <!-- File Upload -->
          <div class="controls">
            <input type="text" id="bank" placeholder="" class="input-large" style="display: none"/>
            <image id="bankImg" style="display: none;" width="30" height="40"></image>
            <a style="cursor: hand" onclick="openUpload('bank')">上传文件</a>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="input01">联系人</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.contact.name">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="input01">联系电话</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.contact.telephone">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="input01">手机</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.contact.mobile">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <label class="control-label" for="input01">电子邮箱</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.contact.email">
            <p class="help-block"></p>
          </div>
        </div>
        
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">备用2</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.reserved2">
            <p class="help-block"></p>
          </div>
        </div>
        <div class="control-group">
          <!-- Text input-->
          <label class="control-label" for="input01">备用3</label>
          <div class="controls">
            <input type="text" ng-readonly="!vm.editable" class="input-large" ng-model="vm.user.reserved3">
            <p class="help-block"></p>
          </div>
        </div>
      </div>
    </fieldset>
    <button class="btn btn-primary">保存并提交审核</button>
    <br/>
    <fieldset>
      <div id="legend" class="">
        <legend class="">已上传的资料</legend>
      </div>
      <div class="control-group" ng-show="vm.user.idCardNumberAttachment">
        <!-- Text input-->
        <label class="control-label">身份证资料</label>
        <div class="controls">
          <a target="_blank" ng-href="/api/{{vm.user.idCardNumberAttachment}}">查看附件</a>
          <p class="help-block"></p>
        </div>
      </div>
    </fieldset>
    <fieldset ng-show="vm.user.businessLicenseNumberAttachment">
      <div class="control-group" ng-show="vm.user.businessLicenseNumberAttachment">
        <!-- Text input-->
        <label class="control-label">营业执照</label>
        <div class="controls">
          <a target="_blank" ng-href="/api/{{vm.user.businessLicenseNumberAttachment}}">查看附件</a>
          <p class="help-block"></p>
        </div>
      </div>
    </fieldset>
    <fieldset ng-show="vm.user.organizationNumberAttachment">
      <div class="control-group" ng-show="vm.user.organizationNumberAttachment">
        <!-- Text input-->
        <label class="control-label">组织机构证</label>
        <div class="controls">
          <a target="_blank" ng-href="/api/{{vm.user.organizationNumberAttachment}}">查看附件</a>
          <p class="help-block"></p>
        </div>
      </div>
    </fieldset>
    <fieldset ng-show="vm.user.taxRegistrationNumberAttachment">
      <div class="control-group" ng-show="vm.user.taxRegistrationNumberAttachment">
        <!-- Text input-->
        <label class="control-label">税务登记证</label>
        <div class="controls">
          <a target="_blank" ng-href="/api/{{vm.user.taxRegistrationNumberAttachment}}">查看附件</a>
          <p class="help-block"></p>
        </div>
      </div>
    </fieldset>
    <fieldset ng-show="vm.user.bankLicenseNumberAttachment">
      <div class="control-group" ng-show="vm.user.bankLicenseNumberAttachment">
        <label class="control-label">开户许可证</label>
        <div class="controls">
          <a target="_blank" ng-href="/api/{{vm.user.bankLicenseNumberAttachment}}">查看附件</a>
          <p class="help-block"></p>
        </div>
      </div>
    </fieldset>
  </form>
  <script>
  function openUpload(inputid){
  var url = "../views/upload.html?id="+ inputid;
  var iWidth=400; //弹出窗口的宽度;
  var iHeight=300; //弹出窗口的高度;
  var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置;
  var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口的水平位置;
  window.open(url,'uploadwindow','height='+iHeight+',width='+iWidth+',top='+iTop+',left='+ iLeft +',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
  }
  </script>
  
</div>